home *** CD-ROM | disk | FTP | other *** search
- class mx.screens.Form extends mx.screens.Screen
- {
- var _childForms;
- static var symbolName = "Form";
- static var symbolOwner = mx.screens.Form;
- var className = "Form";
- var _isForm = true;
- var _indexInParentForm = 0;
- var _sendRevealDuringRedraw = true;
- function Form()
- {
- super();
- }
- function get visible()
- {
- return super.visible;
- }
- function set visible(x)
- {
- if(x == true && this.visible == false)
- {
- this._sendRevealDuringRedraw = false;
- }
- super.setVisible(x,false);
- }
- function get indexInParentForm()
- {
- return this._indexInParentForm;
- }
- function get numChildForms()
- {
- return this._childForms.length;
- }
- function get parentIsForm()
- {
- return this.parentForm != null && this.parentForm._isForm;
- }
- function get parentForm()
- {
- var _loc2_ = this._parent;
- while(true)
- {
- if(_loc2_ == null)
- {
- return null;
- }
- if(_loc2_._isForm)
- {
- return mx.screens.Form(_loc2_);
- }
- if(_loc2_._isFormContainer)
- {
- _loc2_ = _loc2_._parent;
- }
- else if(!_loc2_._isForm)
- {
- return null;
- }
- }
- }
- function get rootForm()
- {
- var _loc2_ = this;
- while(_loc2_.parentIsForm)
- {
- _loc2_ = _loc2_.parentForm;
- }
- return _loc2_;
- }
- static function get currentFocusedForm()
- {
- var curFocus;
- curFocus = _root.focusManager.getFocus();
- if(!curFocus || curFocus == undefined)
- {
- curFocus = eval(Selection.getFocus());
- }
- while(curFocus && !curFocus._isForm)
- {
- curFocus = curFocus._parent;
- }
- if(curFocus == undefined)
- {
- return null;
- }
- return mx.screens.Form(curFocus);
- }
- function getChildForm(childIndex)
- {
- return this._childForms[childIndex];
- }
- function drawFocus()
- {
- }
- function init()
- {
- this._childForms = [];
- super.init();
- if(this.parentIsForm)
- {
- this._parent.registerChildForm(this);
- }
- }
- function registerChildForm(form)
- {
- form._indexInParentForm = this._childForms.push(form) - 1;
- }
- function redraw(bAlways)
- {
- super.redraw(bAlways);
- if(this._sendRevealDuringRedraw && this.visible == true)
- {
- this.dispatchEvent({type:"reveal",target:this});
- this._sendRevealDuringRedraw = false;
- }
- }
- function childLoaded(obj)
- {
- super.childLoaded(obj);
- if(obj._containedScreen._isForm)
- {
- var _loc3_ = obj._containedForm;
- var _loc4_ = mx.screens.Form(obj._parent);
- obj._isFormContainer = true;
- obj._containedForm = _loc3_;
- _loc3_._indexInParentForm = _loc4_._childForms.push(_loc3_) - 1;
- }
- }
- function destroyChildAt(childIndex)
- {
- this._childForms.splice(childIndex,1);
- super.destroyChildAt(childIndex);
- }
- }
-